/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package filetransserv;

import java.io.IOException;
import java.net.ServerSocket;
import javax.swing.JList;

/**
 *
 * @author Oscar
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


public class Control implements Runnable {

    private static ServerSocket server;
    private JList Status;
    private String IP;

    public Thread Control(JList Status, String IP) {
        this.Status = Status;
        this.IP = IP;
        Thread t = new Thread(this);
        t.start();
        return t;

    }

    public void closeServer() {
        try {
            server.close();
        } catch (IOException ex) {
            //nothing
        }
    }

    public void run() {
        Server example = new Server();
        server = example.Server(Status);
        example.HandleConnection(IP);
    }
}

